<template>
  <div id="general">
    <span class="text">启动登录:</span>
    <br />
    <el-checkbox border v-model="setting.checked1" disabled
      >开机启动</el-checkbox
    >
    <br />
    <el-checkbox border v-model="setting.checked2" disabled
      >自动登录</el-checkbox
    >
    <br />
    <span class="text">退出方式:</span>
    <br />
    <el-radio label="1" border v-model="setting.radio" @change="change"
      >询问退出方式</el-radio
    >
    <br />
    <el-radio label="2" border v-model="setting.radio" @change="change"
      >默认直接退出</el-radio
    >
    <br />
    <el-radio label="3" border v-model="setting.radio" @change="change"
      >默认自动隐藏</el-radio
    >
  </div>
</template>
<script>
export default {
  data() {
    return {
      setting: {
        checked1: false,
        checked2: true,
        radio: "1",
      },
    };
  },
  methods: {
    change() {
      if (this.setting.radio == "1") {
        localStorage.removeItem("quitStatus");
      } else if (this.setting.radio == "2") {
        localStorage.setItem("quitStatus", "quit");
      } else if (this.setting.radio == "3") {
        localStorage.setItem("quitStatus", "hide");
      }
    },
  },
  mounted() {
    let quitMethod = window.localStorage.getItem("quitStatus");
    if (quitMethod == null) {
      this.setting.radio = "1";
    } else if (quitMethod == "quit") {
      this.setting.radio = "2";
    } else if (quitMethod == "hide") {
      this.setting.radio = "3";
    }
  },
};
</script>

<style lang="scss" scoped>
#general {
  padding-top: 20px;
  .text {
    color: #7e7e7e;
    font-size: 14px;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
      "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    margin-left: 120px;
  }
}
// CheckBox Deep Style
/deep/ .el-checkbox__label {
  width: 120px;
}
/deep/ .el-checkbox.is-bordered {
  border: 1px solid #9c1a1a;
  margin-top: 5px;
  margin-left: 180px;
}

/deep/ .el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
  background-color: #9c1a1a;
  border-color: #9c1a1a;
}

/deep/ .el-checkbox__inner {
  border: 1px solid #7e7e7e;
  background-color: #bacac6;
}

/deep/ .el-checkbox__input.is-focus .el-checkbox__inner {
  border: 1px solid #7e7e7e;
  border-color: #9c1a1a;
}

/deep/ .el-checkbox__input.is-checked + .el-checkbox__label {
  color: #9c1a1a;
}

// RadioBox Deep Style
/deep/ .el-radio__input.is-checked + .el-radio__label {
  color: #9c1a1a;
}

/deep/ .el-radio__input.is-checked .el-radio__inner {
  border-color: #9c1a1a;
  background: #9c1a1a;
}

/deep/ .el-radio.is-bordered {
  border: 1px solid #9c1a1a;
}

/deep/ .el-radio__inner:hover {
  border-color: #9c1a1a;
}

/deep/ .el-radio__inner {
  border: 1px solid #7e7e7e;
  background-color: #bacac6;
}

/deep/ .el-radio.is-bordered {
  border: 1px solid #9c1a1a;
  margin-top: 5px;
  margin-left: 180px;
  width: 175px;
}
</style>
